1. Field of the Invention
This invention relates to a method for updating of source code and object code in a computer program and, more particularly, a software utility program for automating selective updates of source code and corresponding object code.
2. Description of Related Art
The relevant prior art, upon which the present invention includes improvements to, is the make utility originally developed to run on UNIX® systems. A brief discussion of the make command or utility in a UNIX environment is herein discussed to serve as background in disclosing the present invention. The make utility is a software engineering tool for managing and maintaining computer programs. Typically, a program may consist of many component files, and as the number of files in the program increases, the compile time also increases. Similarly, the complexity of compilation commands can increase with the program complexity. In the same way, the likelihood of human error in executing many compilation commands and updating source files can also increase with the program complexity.
The make utility uses a descriptor file containing dependency rules, macros, and suffix rules to instruct make to automatically rebuild the program whenever one of the program component files is modified. The make utility operates by following rules that are provided in its descriptor file, typically called makefile. The make utility saves compile time by selectively recompiling only the files that were effected by changes. Thus, the make utility simplifies the problem of keeping track of modified files, recompiling files, and re-linking those files to produce an executable program.
However, the make command is usually written using shell commands or make syntax. This does not include other languages that may offer greater flexibility for the programmer and greater flexibility in operation of the utility.
The make file includes two elements: targets, and dependencies. The make utility works by comparing the time stamp of each target and its dependencies. If at least one prerequisite file (such as a source file) is newer than the associated target file (such as an associated object file), the make file executes a typical rule, for example, recompiling a source file.
The make utility is mostly used to sort out dependency relations among files. Generally, even relatively small software projects involve a number of files that depend upon each other. For example, a program must be linked from object files, which in turn must be created from assembly language or high-level language source files. If one or more source files are modified, the program must be re-linked after recompiling some, but not necessarily all, of the sources. This selective building is normally repeated many times during the course of the project. It is this process that the make utility addresses. However, the make utility requires explicitly detailing the source files or target files needing to be changed or updated which can take significant amounts of time and be cumbersome. Also, the make command requires building a substantially complete dependency tree before it starts, which can also take an extensive amount of time and computer resources.
Typically, a programmer records all the relationships among set files, and then uses the make utility to automatically perform all updating tasks. The make command has this general form: “make myprog”. The make utility then carries out only those tasks necessitated by source file changes since the previous make command. For example, the make utility examines the file system to determine when the relevant files were last modified. If file A depends on file B, and if B was modified after A, then A must be remade-compiled, linked, edited, substituted in a library.
The command, “make myprog” (where “myprog” is a target program), indicates that the programmer wants to update the version of the program, named “myprog”. Thus, if “myprog” is an executable file, the command indicates the desire to perform all necessary compilation and linking required to create the file. Instead of entering a great many compiler commands, the make utility automates the process. The program requiring an update (“myprog” in the above example) is called the target of the operation. The program is built from one or more associated files called prerequisites or dependents. Each of these files, may in turn, have other files as prerequisites or dependents. For instance, executable programs are built by linking object files. When source files have changed, typically it is desirable to recompile the object files before linking. Thus, each source file is the prerequisite for each object file.
The make utility is sensitive to hierarchies and dependencies, such as source to object, and object to executable relationships. The programmer is responsible for specifying some dependencies in a description file, however, make can determine many dependencies for itself. In deciding which files to build and how to build them, make draws on the names of existing files, the last modified kinds of the files, and a set of built in rules. With this background, a command, like, “make myprog”, operates such that all necessary parts of the hierarchy are updated.
Thus, the make utility was created to help programmers manage software development projects and files associated with those projects. The need for such a tool as the make command stems from typical scenarios encountered by programmers and software developers. For example, if a programmer is working on a number of programs that will be compiled and linked together to form a single executable program, every time a file is changed the file must be recompiled, then re-linked with the existing object file to create a new executable program.
This sequence presents a significant problem in which the programmer has to remember which files have been modified and, consequently, which files have to be recompiled. Thus, recompiling soon becomes a cumbersome and a difficult task prone to errors and omissions. The make utility handles many details in compiling modified files. To accomplish the task, make follows a set of rules that are provided in a special file called a makefile.
More specifically, make operates by comparing the date and time of a source file with the date and time of the associated object file. Together, the date and time are called the time stamp. If the comparison shows that the source file is newer than the object file, or if the object file does not exist, make performs the task listed in the make file to convert the source file into an object file. In contrast, if the object file is newer then the source file, then make recognizes that is does not have to recompile the source file.
The make utility requires that a target/dependency line must begin in the first column of the line. A command line must be indented. A target is a name followed by a colon. The name appears at the beginning of the line. Two types of dependencies occur in a make file, direct dependencies and indirect dependencies. A direct dependency appears with the target. This means that the target depends on the file or files listed after the colon. An indirect dependency is indirectly related to the first target. However, typically, multiple makefiles are needed to specify cross-directory file dependencies.
Bearing in mind the problems and deficiencies of the prior art, it is therefore an object of the present invention to provide a utility program which more rapidly and efficiently updates target files and their corresponding dependent files.
It is another object of the present invention to provide a utility program using a more flexible programming language.
A further object of the invention is to provide a more effective search technique requiring less intensive computer resources and increased efficiency in the searching process.
It is yet another object of the present invention to provide a utility program which more effectively finds target files.
Still other objects and advantages of the invention will in part be obvious and will in part be apparent from the specification.